#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

void Text(int(*p)[3],int* px,int* py,int k)
{
	int i = 0;
	int y = *py - 1;
	while (i <*px && y >= 0)
	{
		if (p[i][y] < k)
		{
			i++;
		}
		else if (p[i][y] > k)
		{
			y--;
		}
		else
		{
			*px = i;
			*py = y;
		}
	}
}
int main()
{
	int arr[3][3] = { 1,2,3,4,5,6,7,8,9 };
	int k = 7;
	int x = 3;
	int y = 3;
	Text(arr, &x, &y, k);
	printf("%d %d", x, y);
}


